From: Paul Eggert Date: Mon, 4 Apr 2011 09:06:52 +0000 (-0700) Subject: * process.c (read_process_output): Simplify nbytes computation if buffered. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4204^2~26 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=3251dc5d1072c1eeb7278b8540d61b42e9657ad0;p=emacs.git * process.c (read_process_output): Simplify nbytes computation if buffered. --- diff --git a/src/ChangeLog b/src/ChangeLog index 17b5114aefa..4798b5b31f7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,7 @@ (create_pty): Remove unnecessary "volatile"s. (Fnetwork_interface_info): Avoid possibility of int overflow. (read_process_output): Do adaptive read buffering even if carryover. + (read_process_output): Simplify nbytes computation if buffered. * bytecode.c (exec_byte_code): Rename local to avoid shadowing. diff --git a/src/process.c b/src/process.c index 33f41c4a8f0..a9a8eb79ede 100644 --- a/src/process.c +++ b/src/process.c @@ -5205,13 +5205,8 @@ read_process_output (Lisp_Object proc, register int channel) } } #endif - if (buffered) - { - if (nbytes < 0) - nbytes = 1; - else - nbytes = nbytes + 1; - } + nbytes += buffered; + nbytes += buffered && nbytes <= 0; } p->decoding_carryover = 0;